package cn.medemede.model;

import javax.persistence.*;

@Entity
@Table(name = "users")
public class UsersEntity {
    private String username;
    private String zname;
    private String sex;
    private String borth;
    private String phone;
    private String zposition;
    private String email;
    private String favorite;
    private String usercharacter;

    public UsersEntity() { }

    public UsersEntity(String username, String zname, String sex, String borth, String phone, String zposition, String email, String favorite, String usercharacter) {
        this.username = username;
        this.zname = zname;
        this.sex = sex;
        this.borth = borth;
        this.phone = phone;
        this.zposition = zposition;
        this.email = email;
        this.favorite = favorite;
        this.usercharacter = usercharacter;
    }

    @Id
    @Column(name = "username")
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Basic
    @Column(name = "zname")
    public String getZname() {
        return zname;
    }

    public void setZname(String zname) {
        this.zname = zname;
    }

    @Basic
    @Column(name = "sex")
    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    @Basic
    @Column(name = "borth")
    public String getBorth() {
        return borth;
    }

    public void setBorth(String borth) {
        this.borth = borth;
    }

    @Basic
    @Column(name = "phone")
    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Basic
    @Column(name = "zposition")
    public String getZposition() {
        return zposition;
    }

    public void setZposition(String zposition) {
        this.zposition = zposition;
    }

    @Basic
    @Column(name = "email")
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Basic
    @Column(name = "favorite")
    public String getFavorite() {
        return favorite;
    }

    public void setFavorite(String favorite) {
        this.favorite = favorite;
    }

    @Basic
    @Column(name = "usercharacter")
    public String getUsercharacter() {
        return usercharacter;
    }

    public void setUsercharacter(String usercharacter) {
        this.usercharacter = usercharacter;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        UsersEntity that = (UsersEntity) o;

        if (username != null ? !username.equals(that.username) : that.username != null) return false;
        if (zname != null ? !zname.equals(that.zname) : that.zname != null) return false;
        if (sex != null ? !sex.equals(that.sex) : that.sex != null) return false;
        if (borth != null ? !borth.equals(that.borth) : that.borth != null) return false;
        if (phone != null ? !phone.equals(that.phone) : that.phone != null) return false;
        if (zposition != null ? !zposition.equals(that.zposition) : that.zposition != null) return false;
        if (email != null ? !email.equals(that.email) : that.email != null) return false;
        if (favorite != null ? !favorite.equals(that.favorite) : that.favorite != null) return false;
        if (usercharacter != null ? !usercharacter.equals(that.usercharacter) : that.usercharacter != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = username != null ? username.hashCode() : 0;
        result = 31 * result + (zname != null ? zname.hashCode() : 0);
        result = 31 * result + (sex != null ? sex.hashCode() : 0);
        result = 31 * result + (borth != null ? borth.hashCode() : 0);
        result = 31 * result + (phone != null ? phone.hashCode() : 0);
        result = 31 * result + (zposition != null ? zposition.hashCode() : 0);
        result = 31 * result + (email != null ? email.hashCode() : 0);
        result = 31 * result + (favorite != null ? favorite.hashCode() : 0);
        result = 31 * result + (usercharacter != null ? usercharacter.hashCode() : 0);
        return result;
    }
}
